home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / • Other Platforms / PCCTS 1.31 / h / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-10  |  4.9 KB  |  211 lines  |  [TEXT/MPS ]

  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. /*
  4.  * config.h (for ANTLR, DLG, and SORCERER)
  5.  *
  6.  * This is a simple configuration file that doesn't have config stuff
  7.  * in it, but it's a start.
  8.  *
  9.  * SOFTWARE RIGHTS
  10.  *
  11.  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
  12.  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
  13.  * company may do whatever they wish with source code distributed with
  14.  * PCCTS or the code generated by PCCTS, including the incorporation of
  15.  * PCCTS, or its output, into commerical software.
  16.  * 
  17.  * We encourage users to develop software with PCCTS.  However, we do ask
  18.  * that credit is given to us for developing PCCTS.  By "credit",
  19.  * we mean that if you incorporate our source code into one of your
  20.  * programs (commercial product, research project, or otherwise) that you
  21.  * acknowledge this fact somewhere in the documentation, research report,
  22.  * etc...  If you like PCCTS and have developed a nice tool with the
  23.  * output, please mention that you developed it using PCCTS.  In
  24.  * addition, we ask that this header remain intact in our source code.
  25.  * As long as these guidelines are kept, we expect to continue enhancing
  26.  * this system and expect to make other tools available as they are
  27.  * completed.
  28.  *
  29.  * Used by PCCTS 1.31 (SORCERER 1.00B11 and up)
  30.  * Terence Parr
  31.  * Parr Research Corporation
  32.  * with Purdue University and AHPCRC, University of Minnesota
  33.  * 1989-1995
  34.  */
  35.  
  36. /* This file knows about the following ``environments''
  37.     UNIX (default)
  38.     DOS  (use #define PC)
  39.     MAC  (use #define MPW; has a few things for THINK C, Metrowerks)
  40.  */
  41.  
  42. /* should test __STDC__ for 1, but some compilers don't set value, just def */
  43. #ifdef __STDC__
  44. #define __USE_PROTOS
  45. #endif
  46. #ifdef __cplusplus
  47. #ifndef __USE_PROTOS
  48. #define __USE_PROTOS
  49. #endif
  50. #endif
  51.  
  52. #define ATOKEN_H            "AToken.h"
  53. #define ATOKENBUFFER_H        "ATokenBuffer.h"
  54. #define ATOKENBUFFER_C        "ATokenBuffer.C"
  55. #define ATOKENSTREAM_H        "ATokenStream.h"
  56. #define APARSER_H            "AParser.h"
  57. #define APARSER_C            "AParser.C"
  58. #define ASTBASE_H            "ASTBase.h"
  59. #define ASTBASE_C            "ASTBase.C"
  60. #define PCCTSAST_C            "PCCTSAST.C"
  61. #define LIST_C                "List.C"
  62. #define DLEXERBASE_H        "DLexerBase.h"
  63. #define DLEXERBASE_C        "DLexerBase.C"
  64. #define DLEXER_C            "DLexer.C"
  65. #define STREESUPPORT_C        "STreeSupport.C"
  66.  
  67. /* SORCERER Stuff */
  68. #define STPARSER_H            "STreeParser.h"
  69. #define STPARSER_C            "STreeParser.C"
  70.  
  71. #ifdef MPW
  72. #define CPP_FILE_SUFFIX        ".cp"
  73. #define OBJ_FILE_SUFFIX        ".o"
  74. #else
  75. #ifdef PC
  76. #define CPP_FILE_SUFFIX        ".cpp"
  77. #define OBJ_FILE_SUFFIX        ".obj"
  78. #else
  79. #define CPP_FILE_SUFFIX        ".C"
  80. #define OBJ_FILE_SUFFIX        ".o"
  81. #endif
  82. #endif
  83.  
  84. /* User may redefine how line information looks */
  85. #define LineInfoFormatStr "# %d \"%s\"\n"
  86.  
  87. #ifdef MPW        /* Macintosh Programmer's Workshop */
  88. #define ErrHdr "File \"%s\"; Line %d #"
  89. #else
  90. #define ErrHdr "%s, line %d:"
  91. #endif
  92.  
  93.  
  94. /* must assume old K&R cpp here, can't use #if defined(..)... */
  95.  
  96. #ifdef MPW
  97. #define TopDirectory    ":"
  98. #define DirectorySymbol    ":"
  99. #define OutputDirectoryOption "Directory where all output files should go (default=\":\")"
  100. #else
  101. #ifdef PC
  102. #define TopDirectory    "."
  103. #define DirectorySymbol    "\\"
  104. #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
  105. #else
  106. #define TopDirectory    "."
  107. #define DirectorySymbol    "/"
  108. #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
  109. #endif
  110. #endif
  111.  
  112. #ifdef MPW
  113.  
  114. /* Make sure we have prototypes for all functions under MPW */
  115.  
  116. #include <string.h>
  117. #include <stdlib.h>
  118. #include <CursorCtl.h>
  119. #ifdef __cplusplus
  120. extern "C" {
  121. #endif
  122. extern void fsetfileinfo (char *filename, unsigned long newcreator, unsigned long newtype);
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126.  
  127. /* File creators for various popular development environments */
  128.  
  129. #define MAC_FILE_CREATOR 'MPS '   /* MPW Text files */
  130. #if 0
  131. #define MAC_FILE_CREATOR 'KAHL'   /* THINK C/Symantec C++ Text files */
  132. #endif
  133. #if 0
  134. #define MAC_FILE_CREATOR 'MMCC'   /* Metrowerks C/C++ Text files */
  135. #endif
  136.  
  137. #endif
  138.  
  139. #ifdef MPW
  140. #define DAWDLE    SpinCursor(1)
  141. #else
  142. #define DAWDLE
  143. #endif
  144.  
  145. #ifdef __cplusplus
  146. inline
  147. #else
  148. static
  149. #endif
  150. #ifdef MPW
  151. void special_inits()
  152. {
  153.   InitCursorCtl((acurHandle) 0);
  154. }
  155. #else
  156. void special_inits()
  157. {
  158. }
  159. #endif
  160.  
  161. #ifdef __cplusplus
  162. inline
  163. #else
  164. static
  165. #endif
  166. #ifdef MPW
  167. void special_fopen_actions(char *s)
  168. {
  169.   fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT');
  170. }
  171. #else
  172. void
  173. #ifdef __USE_PROTOS
  174. special_fopen_actions(char *s)
  175. #else
  176. special_fopen_actions(s)
  177. char *s;
  178. #endif
  179. {
  180. }
  181. #endif
  182.  
  183. /* Define usable bits for set.c stuff */
  184. #define BytesPerWord    sizeof(unsigned)
  185. #define    WORDSIZE        (sizeof(unsigned)*8)
  186. #define LogWordSize     (WORDSIZE==16?4:5)
  187.  
  188. #ifndef TRUE
  189. #define TRUE 1
  190. #endif
  191. #ifndef FALSE
  192. #define FALSE 0
  193. #endif
  194.  
  195. #ifdef VAXC
  196. #define zzDIE        return 0;
  197. #define zzDONE    return 1;
  198. #else
  199. #define zzDIE        return 1;
  200. #define zzDONE    return 0;
  201. #endif
  202.  
  203. #ifdef USER_ZZMODE_STACK
  204. # ifndef ZZSTACK_MAX_MODE
  205. #  define  ZZSTACK_MAX_MODE 32
  206. # endif
  207. # define  ZZMAXSTK (ZZSTACK_MAX_MODE * 2)
  208. #endif
  209.  
  210. #endif
  211.